package com.example.apartment.domain;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * 管理员实体类
 *
 * @author wuzexin
 * @date 2021/10/27 16:55
 */
public class Admin {

    // 主键 设置id自增
    @TableId(type = IdType.AUTO)
    private Long id;

    // 用户名
    private String username;

    // 密码
    private String password;

    // 手机号码
    private String cellphone;

    // 角色 （0-注册未审核，1-系统管理员，2-宿舍管理员）
    private int role;

    // 所管宿舍楼id（主要对应role==2的对象）
    @TableField(updateStrategy  = FieldStrategy.IGNORED)
    private Integer buildingId;

    // 宿舍楼名字
    @TableField(exist = false)
    private String buildingName;
    // roleName
    @TableField(exist = false)
    private String roleName;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCellphone() {
        return cellphone;
    }

    public void setCellphone(String cellphone) {
        this.cellphone = cellphone;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getBuildingId() {
        return buildingId;
    }

    public void setBuildingId(Integer buildingId) {
        this.buildingId = buildingId;
    }

    public String getBuildingName() {
        return buildingName;
    }

    public void setBuildingName(String buildingName) {
        this.buildingName = buildingName;
    }

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", cellphone='" + cellphone + '\'' +
                ", role=" + role +
                ", buildingId=" + buildingId +
                ", buildingName='" + buildingName + '\'' +
                ", roleName='" + roleName + '\'' +
                '}';
    }
}
